
package soapclient;

import java.util.UUID;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;


/**
 * <p>Java class for reading complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="reading">
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="date" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
 *         &lt;element name="energy" type="{http://www.w3.org/2001/XMLSchema}double"/>
 *         &lt;element name="meterID" type="{http://www.w3.org/2001/XMLSchema}int"/>
 *         &lt;element name="power" type="{http://www.w3.org/2001/XMLSchema}double"/>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "reading", propOrder = {
    "date",
    "energy",
    "meterID",
    "power"
})
public class Reading {

    protected long date=System.currentTimeMillis() - (System.currentTimeMillis() % (1000 * 60 * 15));
    protected double energy=5;
    protected double power;
    protected int meterID;
    /**
	 * Just for creating test data
	 */
	private static long curEnergy = 5; 
	private static long curTime = System.currentTimeMillis() - (System.currentTimeMillis() % (1000 * 60 * 15)); 
    public Reading()
    {
    	curEnergy += Math.random() * 2; // KWH
		this.setEnergy(curEnergy);
		this.setPower(Math.random() * 800 + 200); // 200 to 1000 Watt
		curTime+= 1000 * 60 * 15;
		setDate(System.currentTimeMillis()/1000);	
		this.meterID = (int)(UUID.randomUUID().getLeastSignificantBits());
    }
    
    /**
     * Gets the value of the meterID property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public int getMeterID() {
        return meterID;
    }

    /**
     * Sets the value of the meterID property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setMeterID(int value) {
        this.meterID = value;
    }

    /**
     * Gets the value of the date property.
     * 
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *     
     */
    public long getDate() {
        return date;
    }

    /**
     * Sets the value of the date property.
     * 
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *     
     */
    public void setDate(long value) {
        this.date = value;
    }

    /**
     * Gets the value of the energy property.
     * 
     */
    public double getEnergy() {
        return energy;
    }

    /**
     * Sets the value of the energy property.
     * 
     */
    public void setEnergy(double value) {
        this.energy = value;
    }


    /**
     * Gets the value of the power property.
     * 
     */
    public double getPower() {
        return power;
    }

    /**
     * Sets the value of the power property.
     * 
     */
    public void setPower(double value) {
        this.power = value;
    }

}
